package com.nes.rabbitmq.springboot.simple;

import com.nes.rabbitmq.springboot.RabbitmqConfigure;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by wdq on 17-3-13.
 */
@Service
public class Sender {

    @Autowired
    private AmqpTemplate amqpTemplate;

    public void send(){
        System.out.println("发送消息...");
        amqpTemplate.convertAndSend(RabbitmqConfigure.QUEUE_NAME,"这是消息内容");
    }
}
